import React, { useEffect, useState } from 'react';
import { getProNum , getUserNum} from "../../api/home"


const Com = () => {
  const [proNum , setProNum] = useState(0)
  const [userNum , setUserNum ] = useState(0)  

  useEffect(() => {
    getProNum().then(res=>{
      // console.log(res);
      setProNum(res.data.data)
    })
    getUserNum().then(res => {
      // console.log(res);
      setUserNum(res.data.data)
    })
  }, [])
    return (
      <div>
        <h3>商品数量:：{proNum}</h3><hr /><h3>用户数量:{userNum}</h3>
      </div>
    );

}

export default Com